<template>
    <div>
        <!-- 面包屑导航区域 -->
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>商品管理</el-breadcrumb-item>
            <el-breadcrumb-item>修改商品</el-breadcrumb-item>
        </el-breadcrumb>
        <el-card>
            修改商品页面
            商品id{{ productId }}
        </el-card>
    </div>
</template>
<script>
export default {
    data() {
        return {
            productId: ''
        }
    },
    //切换当前组件时获取路由里的商品id
    activated() {
        if (this.$route.query.productId) {
            this.productId = this.$route.query.productId;
        }
    },
    watch: {
        //监听商品id的改变
        productId: function(val) {
            console.log(val);
        }
    }
}
</script>
<style lang="less" scoped>

</style>
